package cz.cuni.amis.pogamut.episodic.memory;

/**
 *
 * @author Michal Cermak
 */
public class Parameters {

    /**
     * Defines how quickly chronobag capacity decreases.
     * Retention function is a simple power function, as shown by Wagenaar/Rubin.
     */
    // Values shown by Wagenaar: 0.53 * x ^ -0.36 (on a scale 0-1)
    // Rubin : x ^ -0.78
    public double FORGETTING_CURVE_COEFFICIENT = 0.54;
    // Indexed by level.
    static public double[] FORGETTING_CURVE_EXPONENT = {-0.8, -0.7, -0.5, -0.36};

    /**
     * Input events can contain object of affordance type "perceived".
     * This is for schema experiment only. Generally we do want the agent
     * to remember just what he did and used, not everything he saw.
     */
    public boolean REMEMBER_SEEN_ITEMS = true;
    /**
     * Disables the creation of multi-day chronobags. Each chronobag will
     * represent single day.
     */
    public boolean NO_ABSTRACT_CHRONOBAGS = false;
    /**
     * Disables the forgetting of nodes. No memories will be deleted from
     * the chronobags.
     */
    public boolean NO_FORGETTING = false;
    /**
     * Disables the merging of similar episodes inside chronobag. Each episode
     * will be stand-alone until it is deleted.
     */
    public boolean NO_EPISODE_MERGING = false;

    public double MAX_OBJECT_SCORE = 80;
    public double MIN_OBJECT_SCORE = 20;
    public double DEFAULT_OBJECT_SCORE = 50;
    public double MAX_NODE_SCORE = 100;

    /**
     * 1 means only absolutely derivable objects will be added.
     * 0 means all possible objects will be derived
     */
    public double PERCENTAGE_TO_DERIVE_OBJECT = 0.5;
    //public final double PERCENTAGE_TO_DERIVE_SUBNODE = 0.5;
    //not used because all actions are derived and one best intention is derived

    public double EPISODE_COPY_THRESHOLD_SCORE = -1; //low because attractivity of most nodes is currently 0

    static public int MAX_CHRONOBAG_LEVELS = 4; //0-3

    // Indexed by chronobag level
    // NOTE: Level lengths must be congruential
    static public int[] CHRONOBAG_INTERVAL_LENGHTS = {1,7,28,336};
    static public int[] LANDMARK_AGE_THRESHOLDS = {100, 700, 2800, 4000};

    //minimum attractivity of episode node to increase chronobag score
    public double CHRONOBAG_SCORE_NODE_THRESHOLD = 40;

    public int MAX_CHRONOBAG_NODES = 400;

    //tolerance in episode difference for each day when deciding episode merging
    public double DECIDE_EPISODE_MERGING_COEFFICIENT = 0.03;

    // Threshold to stop attempting to Derive-forget nodes.
    // Nodes older than this are extremely unlikely to get forgotten due to
    // new facts, and this puts a stop to the combinatorial explosion associated
    // with constant episode deriving.
    public double EPISODE_DERIVE_FORGET_THRESHOLD = 5;

    /****************************** Schemas **********************************/
    public int HIGHLEVEL_SCHEMA_MIN_SIZE = 1;
    public int MAX_SCHEMA_COMBINATION_COUNT = 3;

    /****************************** NODE SCORE *******************************/

    public double NODE_SCORE_DERIVABILITY_WEIGHT = 20; // out of 100;
    public double NODE_SCORE_ACTUAL_COUNT_WEIGHT = 10; // out of 100;
    public double NODE_SCORE_CREATION_COUNT_WEIGHT = 10; // out of 100;
    public double NODE_SCORE_BOTTOM_WEIGHT = 10; // out of 100;
    public double NODE_SCORE_ATTRACTIVITY_WEIGHT = 30; // out of 100;
    public double NODE_SCORE_AFFORDANCES_WEIGHT = 20; // out of 100;

    /***************************** VISUALIZATION *****************************/

    public int NODES_X_MARGIN = 50;
    public int NODES_Y_MARGIN = 50;

    /******************************** RECALL *********************************/

    public double EPISODE_TREE_RELIANCE = 0.8;

}
